
/*
拿到锁之后才能操作锁
syncsed(lock1){
  lock1.wait(); try-cathch
  lock1.notify();  不需要

}
 */
public class J1wait {
    static Object lock1 = new Object();
    static Object lock2 = new Object();

    public static void main(String[] args) {
        synchronized (lock1){
//            lock1.notify();
            try {
                lock2.notify();
            }catch (Exception e){

            }
        }
    }
}
